package com.sugar.queryinfo.module.business.framework.web.data.permission;

import com.sugar.queryinfo.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
import com.sugar.queryinfo.module.business.dal.dataobject.dataquery.DataQueryDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataquerydtjd.DataQueryDtjdDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataqueryfqz.DataQueryFqzDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataqueryfyxq.DataQueryFyxqDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataquerylsbg.DataQueryLsbgDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataqueryqjda.DataQueryQjdaDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataqueryqjld.DataQueryQjldDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataquerytanzc.DataQueryTanzcDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataquerywdgz.DataQueryWdgzDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataqueryxfhx.DataQueryXfhxDO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataqueryzwsc.DataQueryZwscDO;
import com.sugar.queryinfo.module.business.dal.dataobject.infocomparison.InfoComparisonDO;
import com.sugar.queryinfo.module.business.dal.dataobject.userauth.UserAuthDO;
import com.sugar.queryinfo.module.business.dal.dataobject.userbalancerecord.UserBalanceRecordDO;
import com.sugar.queryinfo.module.system.dal.dataobject.dept.DeptDO;
import com.sugar.queryinfo.module.system.dal.dataobject.user.AdminUserDO;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * business 模块的数据权限 Configuration
 *
 * @author Ysugar
 */
@Configuration(proxyBeanMethods = false)
public class BusinessDataPermissionConfiguration {

    @Bean
    public DeptDataPermissionRuleCustomizer businessDeptDataPermissionRuleCustomizer() {
        return rule -> {
            // dept
            rule.addDeptColumn(InfoComparisonDO.class, "dept_id");
            rule.addDeptColumn(DataQueryDO.class, "dept_id");
            rule.addDeptColumn(DataQueryTanzcDO.class, "dept_id");
            rule.addDeptColumn(DataQueryQjldDO.class, "dept_id");
            rule.addDeptColumn(DataQueryQjdaDO.class, "dept_id");
            rule.addDeptColumn(DataQueryFyxqDO.class, "dept_id");
            rule.addDeptColumn(DataQueryZwscDO.class, "dept_id");
            rule.addDeptColumn(DataQueryLsbgDO.class, "dept_id");
            rule.addDeptColumn(DataQueryWdgzDO.class, "dept_id");
            rule.addDeptColumn(DataQueryFqzDO.class, "dept_id");
            rule.addDeptColumn(DataQueryXfhxDO.class, "dept_id");
            rule.addDeptColumn(DataQueryDtjdDO.class, "dept_id");
            rule.addDeptColumn(UserAuthDO.class, "dept_id");
            rule.addDeptColumn(UserBalanceRecordDO.class, "dept_id");
            // user
            rule.addUserColumn(InfoComparisonDO.class, "user_id");
            rule.addUserColumn(DataQueryDO.class, "user_id");
            rule.addUserColumn(DataQueryTanzcDO.class, "user_id");
            rule.addUserColumn(DataQueryQjldDO.class, "user_id");
            rule.addUserColumn(DataQueryQjdaDO.class, "user_id");
            rule.addUserColumn(DataQueryFyxqDO.class, "user_id");
            rule.addUserColumn(DataQueryZwscDO.class, "user_id");
            rule.addUserColumn(DataQueryLsbgDO.class, "user_id");
            rule.addUserColumn(DataQueryWdgzDO.class, "user_id");
            rule.addUserColumn(DataQueryFqzDO.class, "user_id");
            rule.addUserColumn(DataQueryXfhxDO.class, "user_id");
            rule.addUserColumn(UserAuthDO.class, "user_id");
            rule.addUserColumn(UserBalanceRecordDO.class, "user_id");
            //rule.addUserColumn(CaseVideoDO.class, "creator");
        };
    }

}
